package com.mmall.dao;

import com.mmall.pojo.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    Cart selectCartByUserIDandProductID(@Param("userid") Integer userid, @Param("productid") Integer productid);

    List<Cart> selectCartByUserId(@Param("userid") Integer userid);

    int selectProductCheckedByUserId(@Param("userid") Integer userid);

    int deleteByUserIDandProductIds(@Param("userid") Integer userid, @Param("productids") List<String> productids);

    int checkedorUnchecked(@Param("userid") Integer userid, @Param("checked") Integer checked, @Param("productid") Integer productid);

    int getCartProductCount(@Param("userid") Integer userid);


    List<Cart> selectCheckedCartByUserID(@Param("userid") Integer userid);
}